//
//  AboutView.m
//  listFont
//
//  Created by xiewei.max@gmail.com on 09-12-3.
//  Copyright 2009 xiewei.max@gmail.com. All rights reserved.
//

#import "AboutView.h"


@implementation AboutView


- (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        // Initialization code
		self.backgroundColor = [UIColor groupTableViewBackgroundColor];
		
		UITextView *m_textView = [[UITextView alloc] initWithFrame: CGRectMake(0, 60, 320, 440)];
		m_textView.font = [UIFont fontWithName: @"Zapfino" size: 14];
		m_textView.text = @"Developer: xiewei.max@gmail.com\n"
						   "Please drop me an email if you want the source code of this programme.";
		m_textView.backgroundColor = [UIColor clearColor];
		m_textView.editable = NO;
		[self addSubview: m_textView];
		
		UIButton *m_backButton = [UIButton buttonWithType: UIButtonTypeRoundedRect];
		[m_backButton setTitle: @"Back" forState: UIControlStateNormal];
		m_backButton.frame = CGRectMake(130, 300, 60, 30);
		[m_backButton addTarget: self action: @selector(goBack) forControlEvents: UIControlEventTouchUpInside]; 
		[self addSubview: m_backButton];
    }
	
    return self;
}


- (void)goBack
{
	[UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.75];
    [UIView setAnimationDelegate: self];
    [UIView setAnimationDidStopSelector:@selector(transitionDidStop:finished:context:)];
	
	[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView: [self superview] cache:YES];
	[self removeFromSuperview];
	
	[UIView commitAnimations];
}


- (void)dealloc {
    [super dealloc];
}


@end
